import 'package:flutter/material.dart';
void main() => runApp(MyApp());
//应用结构
class MyApp extends StatelessWidget{
  @override
  Widget build(BuildContext context){
    return MaterialApp(
        title: 'flutter widget',
        //应用程序的主题，各种的定制颜色都可以设置，用于程序主题切换
        theme: ThemeData(
          //主题色 蓝色
          primarySwatch: Colors.blue,
        ),
        home:Scaffold(
            appBar: AppBar(
              title: Text('Flutter之Container组件'),
              centerTitle: true,
              primary: true, //是否设置内容避开状态栏
            ),
            body:Center(
              child: Container(
                child: new Text(
                  'Container组件学习',
                  style: TextStyle(
                    fontSize: 30.0,
                    color: Colors.red,
                    fontWeight: FontWeight.bold
                  ),
                ),
//                padding: const EdgeInsets.all(12.0),
                padding: const EdgeInsets.fromLTRB(50.0,10.0,0.0,0.0),
                margin: const EdgeInsets.all(20.0),
                decoration:new BoxDecoration(
                  gradient: const LinearGradient(
                      colors: [Colors.red,Colors.green,Colors.purple]
                  ),
                  border: Border.all(
                    width: 5.0,
                    color: Colors.blue,
                  ),
                  borderRadius: BorderRadius.circular(20.0),
                  boxShadow: [
                    BoxShadow(
                        color: Colors.black54,
                        offset: Offset(2.0, 2.0),
                        blurRadius: 20.0
                    )
                  ]
                ) ,
                width: 500.0,
                height: 300.0,
//                transform: Matrix4.rotationZ(0.5),
//                color: Colors.green,
                alignment: Alignment.topLeft,
              ),
            )
        )
    );
  }
}